# CMakeLists.txt

# cmake最小版本需求
cmake_minimum_required(VERSION 3.28)

# 项目名
# project(TestName_1.0.1)
project(TestName VERSION 1.0.1)

# 设置变量
set(SRCDIR $(pwd))

# 编译参数
set(CMAKE_C_FLAGS "-O2 -Wall")

# 添加子目录
add_subdirectory(./lib)

# 添加头文件路径
# include_directories(./inc) 
include_directories(${SRCDIR}/inc)

# 修改可执行文件生成路径
# set(EXECUTABLE_OUTPUT_PATH ./bin)
# set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build) # /32-cmake/bin

# 添加源文件和依赖
add_executable(main main.c sum.c)


# 指定不同的工具链
# cmake .. -DCMAKE_TOOLCHAIN_FILE=A.make
# cmake .. -DCMAKE_TOOLCHAIN_FILE=B.make